;(function(doc, win) {
  const docEL = document.documentElement
  const resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
  const resize = () => {
    const clientWidth = docEL.clientWidth
    if (!clientWidth) return
    if (clientWidth >= 750) {
      docEL.style.fontSize = '1px'
    } else {
      docEL.style.fontSize = clientWidth / 750 + 'px'
    }
  }
  if (!doc.addEventListener) return
  win.addEventListener(resizeEvt, resize, false)
  doc.addEventListener('DOMContentLoaded', resize, false)
})(document, window)
